//     https://www.nowcoder.com/practice/661c49118ca241909add3a11c96408c8





#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    int k, d;
    cin >> k >> d;

    vector<vector<long long>> dp_max(k, vector<long long>(n));
    vector<vector<long long>> dp_min(k, vector<long long>(n));

    for (int i = 0; i < n; i++)
        dp_max[0][i] = dp_min[0][i] = a[i];

    long long ans = 0;

    for (int i = 1; i < k; i++)
        for (int j = 0; j < n; j++)
            for (int l = 1; l <= d; l++)
                if (j - l >= 0)
                {
                    dp_max[i][j] = max(dp_max[i][j], max(dp_max[i - 1][j - l] * a[j], dp_min[i - 1][j - l] * a[j]));
                    dp_min[i][j] = min(dp_min[i][j], min(dp_max[i - 1][j - l] * a[j], dp_min[i - 1][j - l] * a[j]));
                }

    for (int i = k - 1; i < n; i++)
        ans = max(ans, dp_max[k - 1][i]);

    cout << ans << endl;

    return 0;
}